﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using GraphDrawer.SocialNetworks;

namespace GraphDrawer {
	public partial class Root : UserControl {
		public static MainMenu mainMenu;
		public static DiseasesModels diseasesModels;
		public static InoculationStrategies inoculationStrategies;
		public static SpreadVisualization spreadVisualization;
		public static ReportsWizard reports;
        public static SocialNetworksList socialNetworksList;
		
		public Root() {
			InitializeComponent();

			mainMenu = new MainMenu(this);
            diseasesModels =new DiseasesModels(this);
			inoculationStrategies = new InoculationStrategies(this);
			spreadVisualization = new SpreadVisualization(this);
			reports = new ReportsWizard(this);
            socialNetworksList = new SocialNetworksList(this);

			Loaded += new RoutedEventHandler(Root_Loaded);
			SizeChanged += new SizeChangedEventHandler(Root_SizeChanged);
		}

		void Root_SizeChanged(object sender, SizeChangedEventArgs e) {
			if (this.LayoutRoot.Children.Count > 0) {
				((UserControl)this.LayoutRoot.Children[0]).Width = e.NewSize.Width;
				((UserControl)this.LayoutRoot.Children[0]).Height = e.NewSize.Height;
			}
		}

		void Root_Loaded(object sender, RoutedEventArgs e) {
			this.LayoutRoot.Children.Add(mainMenu);
		}
		
		public void LoadMainMenu() {
			App.Current.Host.Content.IsFullScreen = false;
			this.LayoutRoot.Children.Clear();
			this.LayoutRoot.Children.Add(mainMenu);
		}
		
		public void LoadDiseasesModels() {
			this.LayoutRoot.Children.Clear();
			this.LayoutRoot.Children.Add(diseasesModels);
		}

		public void LoadInoculationStrategies() {
			this.LayoutRoot.Children.Clear();
			this.LayoutRoot.Children.Add(inoculationStrategies);
		}

		public void LoadSpreadVisualization() {
			this.LayoutRoot.Children.Clear();
			this.LayoutRoot.Children.Add(spreadVisualization);
		}

		public void LoadReports() {
			this.LayoutRoot.Children.Clear();
			this.LayoutRoot.Children.Add(reports);
		}

        public void LoadSocialNetworks()
        {
            this.LayoutRoot.Children.Clear();
            this.LayoutRoot.Children.Add(socialNetworksList);
        }

        public void LoadSocialNetworksViewer(SocialNetworkViewer viewer)
        {
            this.LayoutRoot.Children.Clear();
            this.LayoutRoot.Children.Add(viewer);
        }
	}
}
